home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Online / Apache / include / php / Zend / zend_globals.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-21  |  5.2 KB  |  221 lines

  1. /*
  2.    +----------------------------------------------------------------------+
  3.    | Zend Engine                                                          |
  4.    +----------------------------------------------------------------------+
  5.    | Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
  6.    +----------------------------------------------------------------------+
  7.    | This source file is subject to version 0.92 of the Zend license,     |
  8.    | that is bundled with this package in the file LICENSE, and is        | 
  9.    | available at through the world-wide-web at                           |
  10.    | http://www.zend.com/license/0_92.txt.                                |
  11.    | If you did not receive a copy of the Zend license and are unable to  |
  12.    | obtain it through the world-wide-web, please send a note to          |
  13.    | license@zend.com so we can mail you a copy immediately.              |
  14.    +----------------------------------------------------------------------+
  15.    | Authors: Andi Gutmans <andi@zend.com>                                |
  16.    |          Zeev Suraski <zeev@zend.com>                                |
  17.    +----------------------------------------------------------------------+
  18. */
  19.  
  20.  
  21. #ifndef ZEND_GLOBALS_H
  22. #define ZEND_GLOBALS_H
  23.  
  24.  
  25. #include <setjmp.h>
  26.  
  27. #include "zend_globals_macros.h"
  28.  
  29. #include "zend_stack.h"
  30. #include "zend_ptr_stack.h"
  31. #include "zend_hash.h"
  32. #include "zend_llist.h"
  33. #include "zend_fast_cache.h"
  34.  
  35. /* Define ZTS if you want a thread-safe Zend */
  36. /*#undef ZTS*/
  37.  
  38. #ifdef ZTS
  39. #include "../TSRM/TSRM.h"
  40.  
  41. #ifdef __cplusplus
  42. class ZendFlexLexer;
  43. class ZendIniFlexLexer;
  44. #endif
  45.  
  46. BEGIN_EXTERN_C()
  47. ZEND_API extern int compiler_globals_id;
  48. ZEND_API extern int executor_globals_id;
  49. ZEND_API extern int alloc_globals_id;
  50. END_EXTERN_C()
  51.  
  52. #endif
  53.  
  54. #define SYMTABLE_CACHE_SIZE 32
  55.  
  56.  
  57. #include "zend_compile.h"
  58.  
  59. /* excpt.h on Digital Unix 4.0 defines function_table */
  60. #undef function_table
  61.  
  62.  
  63. typedef struct _zend_declarables {
  64.     zval ticks;
  65. } zend_declarables;
  66.  
  67.  
  68. struct _zend_compiler_globals {
  69.     zend_stack bp_stack;
  70.     zend_stack switch_cond_stack;
  71.     zend_stack foreach_copy_stack;
  72.     zend_stack object_stack;
  73.     zend_stack declare_stack;
  74.  
  75.     zend_class_entry class_entry, *active_class_entry;
  76.  
  77.     /* variables for list() compilation */
  78.     zend_llist list_llist;
  79.     zend_llist dimension_llist;
  80.  
  81.     zend_stack function_call_stack;
  82.  
  83.     char *compiled_filename;
  84.  
  85.     int zend_lineno;
  86.     int comment_start_line;
  87.     char *heredoc;
  88.     int heredoc_len;
  89.  
  90.     zend_op_array *active_op_array;
  91.  
  92.     HashTable *function_table;    /* function symbol table */
  93.     HashTable *class_table;        /* class table */
  94.  
  95.     HashTable filenames_table;
  96.  
  97.     zend_bool in_compilation;
  98.     zend_bool short_tags;
  99.     zend_bool asp_tags;
  100.     zend_bool allow_call_time_pass_reference;
  101.  
  102.     zend_declarables declarables;
  103.  
  104.     /* For extensions support */
  105.     zend_bool extended_info;    /* generate extension information for debugger/profiler */
  106.     zend_bool handle_op_arrays;    /* run op_arrays through op_array handlers */
  107.  
  108.     zend_bool unclean_shutdown;
  109.  
  110.     zend_bool ini_parser_unbuffered_errors;
  111.  
  112.     zend_llist open_files;
  113. #if defined(ZTS) && defined(__cplusplus)
  114.     ZendFlexLexer *ZFL;
  115.     ZendIniFlexLexer *ini_scanner;
  116. #else
  117.     void *ZFL;
  118.     void *ini_parser;
  119. #endif
  120. };
  121.  
  122.  
  123. struct _zend_executor_globals {
  124.     zval **return_value_ptr_ptr;
  125.  
  126.     zval uninitialized_zval;
  127.     zval *uninitialized_zval_ptr;
  128.  
  129.     zval error_zval;
  130.     zval *error_zval_ptr;
  131.  
  132.     zend_function_state *function_state_ptr;
  133.     zend_ptr_stack arg_types_stack;
  134.  
  135.     /* for global return() support */
  136.     zval *global_return_value_ptr;
  137.  
  138.     /* symbol table cache */
  139.     HashTable *symtable_cache[SYMTABLE_CACHE_SIZE];
  140.     HashTable **symtable_cache_limit;
  141.     HashTable **symtable_cache_ptr;
  142.  
  143.     zend_op **opline_ptr;
  144.  
  145.     HashTable *active_symbol_table;
  146.     HashTable symbol_table;        /* main symbol table */
  147.  
  148.     HashTable included_files;    /* files already included */
  149.  
  150.     jmp_buf bailout;
  151.  
  152.     int error_reporting;
  153.     int orig_error_reporting;
  154.     int exit_status;
  155.  
  156.     zend_op_array *active_op_array;
  157.  
  158.     HashTable *function_table;    /* function symbol table */
  159.     HashTable *class_table;        /* class table */
  160.     HashTable *zend_constants;    /* constants table */
  161.  
  162.     long precision;
  163.  
  164.     int ticks_count;
  165.  
  166.     zend_bool in_execution;
  167.  
  168.     /* for extended information support */
  169.     zend_bool no_extensions;
  170.  
  171. #ifdef ZEND_WIN32
  172.     zend_bool timed_out;
  173. #endif
  174.  
  175.     HashTable regular_list;
  176.     HashTable persistent_list;
  177.  
  178.     zend_ptr_stack argument_stack;
  179.     int free_op1, free_op2;
  180.     int (*unary_op)(zval *result, zval *op1);
  181.     int (*binary_op)(zval *result, zval *op1, zval *op2);
  182.  
  183.     zval *garbage[4];
  184.     int garbage_ptr;
  185.  
  186.     zval *user_error_handler;
  187.     zend_ptr_stack user_error_handlers;
  188.  
  189.     /* timeout support */
  190.     int timeout_seconds;
  191.  
  192.     int lambda_count;
  193.  
  194.     void *reserved[ZEND_MAX_RESERVED_RESOURCES];
  195. #if SUPPORT_INTERACTIVE
  196.     int interactive;
  197. #endif
  198. };
  199.  
  200.  
  201. struct _zend_alloc_globals {
  202.     zend_mem_header *head;        /* standard list */
  203.     zend_mem_header *phead;        /* persistent list */
  204.     void *cache[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES];
  205.     unsigned int cache_count[MAX_CACHED_MEMORY];
  206.     void *fast_cache_list_head[MAX_FAST_CACHE_TYPES];
  207.  
  208. #if ZEND_DEBUG
  209.     /* for performance tuning */
  210.     int cache_stats[MAX_CACHED_MEMORY][2];
  211.     int fast_cache_stats[MAX_FAST_CACHE_TYPES][2];
  212. #endif
  213. #if MEMORY_LIMIT
  214.     unsigned int memory_limit;
  215.     unsigned int allocated_memory;
  216.     unsigned char memory_exhausted;
  217. #endif
  218. };
  219.  
  220. #endif /* ZEND_GLOBALS_H */
  221.